package com.repair.repairSys.service.impl;

import java.util.List;
import com.repair.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.repair.repairSys.mapper.RepairOrdersMapper;
import com.repair.repairSys.domain.RepairOrders;
import com.repair.repairSys.service.IRepairOrdersService;

/**
 * 维修订单Service业务层处理
 * 
 * @author repair
 * @date 2024-12-10
 */
@Service
public class RepairOrdersServiceImpl implements IRepairOrdersService 
{
    @Autowired
    private RepairOrdersMapper repairOrdersMapper;

    /**
     * 查询维修订单
     * 
     * @param id 维修订单主键
     * @return 维修订单
     */
    @Override
    public RepairOrders selectRepairOrdersById(Long id)
    {
        return repairOrdersMapper.selectRepairOrdersById(id);
    }

    /**
     * 查询维修订单列表
     * 
     * @param repairOrders 维修订单
     * @return 维修订单
     */
    @Override
    public List<RepairOrders> selectRepairOrdersList(RepairOrders repairOrders)
    {
        return repairOrdersMapper.selectRepairOrdersList(repairOrders);
    }

    /**
     * 新增维修订单
     * 
     * @param repairOrders 维修订单
     * @return 结果
     */
    @Override
    public int insertRepairOrders(RepairOrders repairOrders)
    {
        repairOrders.setCreateTime(DateUtils.getNowDate());
        return repairOrdersMapper.insertRepairOrders(repairOrders);
    }

    /**
     * 修改维修订单
     * 
     * @param repairOrders 维修订单
     * @return 结果
     */
    @Override
    public int updateRepairOrders(RepairOrders repairOrders)
    {
        return repairOrdersMapper.updateRepairOrders(repairOrders);
    }

    /**
     * 批量删除维修订单
     * 
     * @param ids 需要删除的维修订单主键
     * @return 结果
     */
    @Override
    public int deleteRepairOrdersByIds(Long[] ids)
    {
        return repairOrdersMapper.deleteRepairOrdersByIds(ids);
    }

    /**
     * 删除维修订单信息
     * 
     * @param id 维修订单主键
     * @return 结果
     */
    @Override
    public int deleteRepairOrdersById(Long id)
    {
        return repairOrdersMapper.deleteRepairOrdersById(id);
    }
}
